#pragma once

#include "common/Device.h"
#include "common/Route.h"

#include <map>
#include <set>
#include <string>

namespace nexus {

class Model {
 public:
  Model(/* args */);
  ~Model();

  void addDevice(Device dev) {
    devices_.emplace(dev.name(), dev);
  }

  void addLink(std::string srcDev, std::string srcPort, std::string dstDev, std::string dstPort) {
    auto srcPt = devices_.at(srcDev).getOrCreatePort(srcPort);
    auto dstPt = devices_.at(dstDev).getOrCreatePort(dstPort);
    srcPt.peer = &dstPt;
    dstPt.peer = &srcPt;
  }

  void addRoute(std::string devName, Route& route);

 private:
  std::map<std::string, Device> devices_;
};

} // namespace nexus